//-----------------------------------------------------------------------------
// Name: DisplayManager.h
// Auth: Bradford J. Smith & Robert Darty
// Desc: contains all of the interface required to manipulate the view as well
//		as any additional state information.
//-----------------------------------------------------------------------------

#ifndef _DISPLAYMANAGER_
#define _DISPLAYMANAGER_

//-----------------------------------------------------------------------------
// Type Definitions:
//-----------------------------------------------------------------------------
typedef float tVector3f[3];

//-----------------------------------------------------------------------------
// Constants:
//-----------------------------------------------------------------------------
const int kInitialWindowWidth = 800;
const int kInitialWindowHeight = 600;

const tVector3f kUpVector = {0.0f, 1.9f, 0.0f};

//Enum to deal with keyboard movement
enum eMoveMode
{
	kStartMoveRight,
	kStartMoveLeft,
	kStopMoveRight,
	kStopMoveLeft,

	kStartMoveForward,
	kStartMoveBackward,
	kStopMoveForward,
	kStopMoveBackward,
};


//-----------------------------------------------------------------------------
// cDisplayManager:
//-----------------------------------------------------------------------------
class cDisplayManager
{
public:
	// Constructers:
	cDisplayManager();
	~cDisplayManager();

	// DisplayManager:
	void SetWindowArea(int width, int height);
	int GetWindowWidth();
	int GetWindowHeight();

	//-----------------------------------------------------------------------------
	void SetPerspectiveMode();
	void SetOrthographicMode();
	void UpdateProjection();
	// Desc: controls how the world's projection matrix is created and updated.

	//-----------------------------------------------------------------------------
	void SetCameraPitch(float pitch);
	void SetCameraHeading(float heading);
	void SetCameraOffset(float offset);
	void Move(eMoveMode mode);
	float GetCameraPitch();
	float GetCameraHeading();
	float GetCameraOffset();
	// Desc: allows for basic polar camera manipulation

	//-----------------------------------------------------------------------------
	void UpdateCamera(float elapsedTimeS);
	// Desc: Updates the Camera's movement, takes in time passed per frame

	//-----------------------------------------------------------------------------
	void DrawHUD();
	// Desc: Draws to the Heads up Display

private:
	// Members:
	int mWindowWidth;
	int mWindowHeight;

	enum eProjectionMode
	{
		kOrthographic,
		kPerspective,
	};
	eProjectionMode mProjectionMode;
	
	// Camera Variables:
	tVector3f mCameraPosition; 
	tVector3f mCameraVelocity; 
	float mCameraPitch;
	float mCameraHeading;
	float mCameraOffset;
	float mStrafeSpeed;
	float mForwardSpeed;
	float mAcceleration;

	float mHeadingAcceleration;
	float mHeadingVelocity;
};

#endif